//#pragma once

#ifndef CLIENT_H
#define CLIENT_H

#include <WinSock2.h>
#include "Log.h"

#pragma comment(lib, "Ws2_32.lib")

class CClient
{
public:
	CClient(void);
	~CClient(void);

	BOOL Init();
	BOOL CreateSocket();
	BOOL GetIp(string& ipAddress);
	BOOL Connect(const char *ServerIP, unsigned short ServerPort);
	void Disconnect(); 
	
	DWORD SendBuffer(const char *buf, const int len);
	
	BOOL StartRecvBuffer();

	BOOL SetStopFlag(bool bFlag);
	bool GetStopFlag();

	static DWORD WINAPI RcvBufferFunc(LPVOID lParam);
private:
	SOCKET m_ClientSock;
	CLog *m_pLog;

	bool m_bStop;
};


#endif